package com.gnerv.battle.boot.framework.model.bo;

import com.gnerv.battle.boot.framework.common.tools.DateTimeTools;
import com.gnerv.battle.boot.framework.model.entity.ManageAccount;
import lombok.Data;
import org.springframework.beans.BeanUtils;

import java.io.Serial;
import java.io.Serializable;

/**
 * @author Gnerv LiGen
 */
@Data
public class ManageAccountBO implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    private String tenantUkId;
    private String ukId;
    private String username;
    private String password;
    private String status;
    private Integer sort;

    public ManageAccount toCreateManageAccount() {
        ManageAccount manageAccount = new ManageAccount();
        BeanUtils.copyProperties(this, manageAccount);
        manageAccount.setGmtCreate(DateTimeTools.currentTimeMillis());
        manageAccount.setGmtModified(DateTimeTools.currentTimeMillis());
        return manageAccount;
    }

    public ManageAccount toUpdateManageAccount() {
        ManageAccount manageAccount = new ManageAccount();
        BeanUtils.copyProperties(this, manageAccount);
        manageAccount.setGmtModified(DateTimeTools.currentTimeMillis());
        return manageAccount;
    }

}